$(function(){
	$("#searchHistoryAlarm_dategrid").datagrid_init;
	/*==初始化表格*/
	$('#searchHistoryAlarm_dategrid').datagrid({
		loadMsg : "数据加载中",
        emptyMsg : "数据加载完成,当前无数据!",
		border:false,
		fit : true,
		title : "历史报警查询",
		fitColumns : true,
		pagination : false,
		rownumbers : true,
		singleSelect : true,
		// toolbar:"#searchHistoryAlarm_dategrid_toolbar",
		columns : [ [
		    {field : 'id',				title : '主键',			width:50 , align:'center',hidden:true},
            {field : 'cameraip',				title : '摄像头',			width:50 , align:'center',hidden:false,
                formatter: function(value,row,index){
                    return 	value;
                }
            },
            {field : 'datetime',			title : '时间 ',		width:50 , align:'center',hidden:false,
                formatter: function(value,row,index){
                    return 	value;
                }
            },
            {field : 'imgpath',title : '图片',	width : 30,align : 'center',hidden : false,
                formatter: function(value,row,index){
                    return 	'<a href="#" class="easyui-linkbutton" iconCls="icon-search" onClick="getImageWindow('+value+')">查看</a>';
                }
            }
		] ],
        onLoadSuccess:function(data){
            $(this).datagrid('doCellTip',{'max-width':'300px','delay':500});
        }
	});

	var params = {};
	$("#searchHistoryAlarm_dategrid").datagrid_pagination(basepath+"/user/v1/selectHistoryAlarmList",JSON.stringify(params),"","" );

    /*查询按钮*/
	$("#searchHistoryAlarm_btn_search").linkbutton({
		onClick:function(){
            var datebegin=$.trim($("#searchHistoryAlarm_DateBegin").datetimebox('getValue'));
            var dateend=$.trim($("#searchHistoryAlarm_DateEnd").datetimebox('getValue'));
			var params = {};
			params.datebegin = datebegin;
			params.dateend = dateend;
            $("#searchHistoryAlarm_dategrid").datagrid_pagination(basepath+"/user/v1/selectHistoryAlarmList",JSON.stringify(params),"","" );
		}
	});

});
	